package com.example.demo.publish;

import com.example.demo.DemoApplication;
import com.example.demo.annoations.NotRecommend;
import com.example.demo.annoations.NotThreadSafe;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@NotThreadSafe
@NotRecommend
public class Escape {

    private  int thisCanBeEscape = 0;

    public Escape(){
        new InnerClass();//相当于启动一个线程
    }

    private class InnerClass{
        public InnerClass(){
            log.info("{}", Escape.this.thisCanBeEscape);
        }
    }

    public static void main(String[] args) {
        new Escape();
    }
}
